package com.bysc.commonutils.message;

import com.bysc.commonutils.enums.CommentEnum;
import com.bysc.commonutils.enums.NoticeEnum;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

@Data
@NoArgsConstructor
public class NotificationMessage {
    @ApiModelProperty(value = "评论Id")
    private String commentId;
    @ApiModelProperty(value = "通知类型")
    private Integer type;
    @ApiModelProperty(value = "内容类型")
    private Integer commentType;
    @ApiModelProperty(value = "通知内容")
    private String content;
    @ApiModelProperty(value = "被通知人id")
    private String noticedUserId;
    @ApiModelProperty(value = "通知人id")
    private String userId;
    @ApiModelProperty(value = "通知创建时间")
    private Date gmtCreate;
    public NotificationMessage(String userId, String noticedUserId, String commentId, String content, CommentEnum type, NoticeEnum noticeType) {
        this.setType(noticeType.getValue());
        if (type != null) {
            this.setCommentType(type.getValue());
        }
        this.setContent(content);
        this.setNoticedUserId(noticedUserId);
        this.setUserId(userId);
        this.setCommentId(commentId);
        this.setGmtCreate(new Date());
    }
}
